$(document).ready(function() {
    var iframeSettings = {
        type: "iframe",
        tpl: {
            closeBtn: '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;">X</a>'
        },
        helpers: {
            title: {
                type: 'over', // 'float', 'inside', 'outside' or 'over',
                position: 'top' // 'top' or 'bottom'
            }
        },
        afterClose: function(e) {
            if (this.element.hasClass('reload')) {
                location.href = location.href;
            }
        }
    }
    $('.iframe').fancybox(iframeSettings);
    $('.debug').fancybox({
        type: 'inner',
        minWidth: 600,
        maxHeight: 400,
        tpl: {
            closeBtn: '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;">X</a>'
        },
        beforeLoad: function(){
            this.content = this.element.attr('content');
        }
    });
    $('div.message').each(function(){
       var item = $(this);
       var close = $('<div class="msg-close-btn">');
       close.click(function(){
           $(this).parent().slideUp(300);
       });
       item.append(close);
    });
});

$(window).load(function(){
    setTimeout(function(){$('.preloader').fadeOut(600, initStartupAnimation)}, 300);
});

function initStartupAnimation(){
    
}